/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Key Request Event Arguments Class
 *      Provides an event arguments class for events relating to key requests.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;

namespace Adaptive.Foundation.Security
{
    /// <summary>
    /// Provides an event arguments class for events relating to key requests.
    /// </summary>
    public class KeyRequestEventArgs : EventArgs
    {
        /*--------------------------------------------------------------------------------
         * Private Member Declarations
         *------------------------------------------------------------------------------*/
        #region Private Member Declarations
        /// <summary>
        /// Key value to return to requestor.
        /// </summary>
        private byte[] _keyValue;
        /// <summary>
        /// Operation cancellation flag.
        /// </summary>
        private bool _cancelOperation;
        #endregion

        /*--------------------------------------------------------------------------------
         * Constructor / Dispose / Destructor Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public KeyRequestEventArgs()
            : base()
        {
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Properties
         *------------------------------------------------------------------------------*/
        #region Public Properties
        /// <summary>
        /// Gets or sets the key value to be returned to the caller.
        /// </summary>
        /// <value>
        /// A byte array containing the key value to use for encryption or decryption operations.
        /// </value>
        public byte[] KeyValue
        {
            get
            {
                return _keyValue;
            }
            set
            {
                _keyValue = value;
            }
        }
        /// <summary>
        /// Gets or sets a value indicating whether to cancel the current operation.
        /// </summary>
        /// <value>
        /// <b>true</b> to cancel the operation; otherwise, <b>false</b>.
        /// </value>
        public bool Cancel
        {
            get { return _cancelOperation; }
            set { _cancelOperation = value; }
        }
        #endregion
    }
}